import request from '@/util/request';

const  getPopularJob = async () => {
    try {
        const response = await request.get('/getPopularJob')
        return response.data;
    }catch(error) {
        console.error(' 201 获取热门职业失败:', error);
        throw error;
    }

};

const getJobCategories = async () => {
    try {
        const response = await request.get('/getJobCategories');
        return response.data;
    } catch (error) {
        console.error('获取职位分类失败:', error);
        throw error;
    }
};

const getSelectesJob = async () => {
    try {
        const response = await request.get('/getSelectesJob');
        return response.data;
    } catch (error) {
        console.error('获取精选职位失败:', error);
        throw error;
    }
};

const getLatestJob = async () => {
    try {
        const response = await request.get('/getLatestJob');
        return response.data;
    } catch (error) {
        console.error('获取最新职位失败:', error);
        throw error;
    }
};

const getHotJob = async () => {
    try {
        const response = await request.get('/getHotJob');
        return response.data;
    } catch (error) {
        console.error('获取热门职位失败:', error);
        throw error;
    }
};

export default { 
    getPopularJob,
    getJobCategories,
    getSelectesJob,
    getLatestJob,
    getHotJob
};